﻿using ER.Tests.Data;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ER.Tests.DynamicWebApp.Test
{
    public partial class TestDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string tableName = Request.QueryString["tableName"];
            if (String.IsNullOrWhiteSpace(tableName))
            {
                tableName = "Employees";
            }
            DbContext db = RuntimeDbContextManager.CreateDbContext();
            dynamic set = db.Set(tableName);
            DetailsView1.DataSource = ((object)set).ToList();
            DetailsView1.DataBind();
        }
    }
}